From 47fa53bbb45911f433fc22837d48597f57b846dd Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Wed, 28 Sep 2005 22:18:30 +0100 Subject: [PATCH] Fix fixed-point long multiplication used in time delta calculations. The carry flag was clobbered before it was added to the result. Signed-off-by: Keir Fraser --- linux-2.6-xen-sparse/arch/xen/i386/kernel/time.c | 2 +- xen/arch/x86/time.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/linux-2.6-xen-sparse/arch/xen/i386/kernel/time.c b/linux-2.6-xen-sparse/arch/xen/i386/kernel/time.c index 1de1bb89c0..793977fbd6 100644 --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/time.c +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/time.c @@ -186,8 +186,8 @@ static inline u64 scale_delta(u64 delta, u32 mul_frac, int shift) "mov %4,%%eax ; " "mov %%edx,%4 ; " "mul %5 ; " - "add %4,%%eax ; " "xor %5,%5 ; " + "add %4,%%eax ; " "adc %5,%%edx ; " : "=A" (product), "=r" (tmp1), "=r" (tmp2) : "a" ((u32)delta), "1" ((u32)(delta >> 32)), "2" (mul_frac) ); diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c index 7e972bea94..e7202174f8 100644 --- a/xen/arch/x86/time.c +++ b/xen/arch/x86/time.c @@ -119,8 +119,8 @@ static inline u64 scale_delta(u64 delta, struct time_scale *scale) "mov %4,%%eax ; " "mov %%edx,%4 ; " "mul %5 ; " - "add %4,%%eax ; " "xor %5,%5 ; " + "add %4,%%eax ; " "adc %5,%%edx ; " : "=A" (product), "=r" (tmp1), "=r" (tmp2) : "a" ((u32)delta), "1" ((u32)(delta >> 32)), "2" (scale->mul_frac) ); -- 2.30.2